package kotlin01


fun main() {
    // 按照顺序传递参数
    val fish1 = Fish("罗非鱼", 1, 12)
    val fish2 = Fish(
        price = 300,
        age = 2,
        name = "三文鱼"
    )
    val fish3 = Fish(
        price = 1000,
        name = "鳄鱼",
        age = 2,
    )
    val fish4 = Fish(
        price = 1000,
        name = "鳄鱼",
        age = 2,
    )

    // 使用copy
    val fish5 = fish4.copy(price = 2000, name = "悲痛欲绝的鳄鱼")

    // 解构 ArkTS中不支持，JS和TS中支持
    val (price, name, age) = fish5

//    println(fish3)
//    println(fish4 == fish3) // 数据类中的数据是否相等
//    println(fish4 === fish3)// 是否为同一个对象
//    println(fish5 === fish4)
//    println(fish5)
    println(price + "|" + name + "|" + age)
}

data class Fish(
    val name: String,
    val age: Int,
    val price: Int
)


// 单例
//class DBTool{
//
//}
//
//export const db =new DBTool()